package com.heaboy.collection;

import java.util.Arrays;
import java.util.Scanner;

public class sum {
    public static void main(String[] args) {
        Solution solution=new Solution();
        int[] nums={1,3,2,5};
       int[] a=solution.twoSum(nums,9);
        System.out.println(Arrays.toString(a));
    }
}
class Solution{
    public int[] twoSum(int[] nums,int target){
        int[] arr=new int[2];
        for(int i=0;i<nums.length;i++){
            for(int j=i+1;j<nums.length;j++){
                if(nums[i]+nums[j]==target){
                    arr[0]=i;
                    arr[1]=j;

                }
            }
        }
        return  arr;
    }
}
